/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Pe.edu.unmsm.SIASS.DAOImpl;

import Pe.edu.unmsm.SIASS.DAO.EstadoDAO;
import Pe.edu.unmsm.SIASS.Dominio.Estado;
import Util.HibernateUtil;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author FELIPE
 */
public class EstadoDAOImpl implements EstadoDAO{

    @Override
    public Estado buscarEstado(int idEstado) {
        Session session = HibernateUtil.getSessionFactory().openSession();
        
        session.beginTransaction();
        Query query = session.createQuery("select a from Estado a where a.idEstado="+idEstado);
        return (Estado) query.uniqueResult();
    }
    
}
